<?php
include_once(_APP_PATH. 'modules/admin/controllers/articles/articles_admin_http.php');
class blogs_admin_http extends articles_admin_http
{
	protected $_bpage;
	
    protected function GetBlogQueryPage()
    {
    	if ($this->Request()->hasQuery('bpage'))
    	{
			$this->_bpage = (int)$this->Request()->getQuery('bpage');
			if ($this->_bpage != $this->Request()->getCookie('bpage')) 
			{
		       	$link = MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => 'blogs'));  				
				$this->Request()->SetCookie('bpage', $this->_bpage, 0, $link);   		
			}
    	}
    	else
    	{
    		$this->_bpage = (int)$this->Request()->getCookie('bpage');
    	} 

    	return $this->_bpage;
    } 	
	
    protected function GetBlogFromQueryId()
    {
    	if ($this->_blog !== null) return $this->_blog;

		$blogId = (int)$this->Request()->get('blog');	
		if ($blogId)
		{
			$this->_blog = $this->GetBlogsMapper()->GetById($blogId);
		}
		else
		{
			$this->_blog = false;
		}		
		
		return $this->_blog;    	
    }  
}    